package com.example.demo.filter;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import java.io.IOException;

/**
 * 自定义过滤器
 * @author wch
 */
@Slf4j
public class FirstFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) {
        log.info("走了自定义过滤器init方法");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        log.info("获取用户列表接口走了自定义过滤器doFilter方法");
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        log.info("走了自定义过滤器destroy方法");
    }
}
